package TrueTopic;


import java.util.Scanner;
import java.util.stream.Stream;

public class Test {

    private static int cnt;
    private static int k;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt(), q = sc.nextInt();
            Op[] ops = Stream.generate(() -> new Op(sc.nextInt(), sc.nextInt())).limit(q).toArray(Op[]::new);
            for (k = 0; k <= n; k++) {
                cnt = 0;
                for (int i = 0; i < q; i++) {
                    if (ops[i].op == 1) {
                        add(ops[i].x, n);
                    } else {
                        ask(ops[i].x, n);
                    }
                }
                System.out.println(cnt);
            }
        }
    }

    public static void add(int x, int n) {
        for (int i = x + k; i <= n + k; i += i & -i) {
            cnt++;
        }
    }

    public static void ask(int x, int n) {
        for (int i = x + k; i > 0; i -= i & -i) {
            cnt++;
        }
    }

    public static class Op {
        public int op;
        public int x;

        public Op(int op, int x) {
            this.op = op;
            this.x = x;
        }

        public Op() {
        }

        public int getOp() {
            return op;
        }

        public void setOp(int op) {
            this.op = op;
        }

        public int getX() {
            return x;
        }

        public void setX(int x) {
            this.x = x;
        }
    }
}

